#include<iostream>
#include<functional>
using namespace std;
enum class Event{
    READEVENT=1,   
    WRITEEVENT=2,  
    DESTROYEVENT=4 
};
class FdInfo{
public:
  using callback=function<int(void*arg)>;
  FdInfo();
  FdInfo(int fd,int event,callback readcallback,callback writecallback,callback destroycallback,void*arg);
  ~FdInfo();
  inline int getsocket(){
      return m_fd;
  }
  inline void*getarg(){
      return this->m_arg;
  }
  inline int getevent(){
    return m_event;
  }
  callback readcallback;
  callback writecallback;
  callback destroycallback;
  void changeEvent(Event event);
  int m_event;   //事件
private:
   int m_fd;
   
   void*m_arg;           //回调函数参数
};